package com.lagou.demo.controller;

import com.lagou.demo.service.IDemoService;
import com.lagou.edu.mvcframework.annotations.LagouAutowired;
import com.lagou.edu.mvcframework.annotations.LagouController;
import com.lagou.edu.mvcframework.annotations.LagouRequestMapping;
import com.lagou.edu.mvcframework.annotations.LagouSecurity;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@LagouSecurity("lilei,hanmei")
@LagouController
@LagouRequestMapping("/demo")
public class DemoController {


    @LagouAutowired
    private IDemoService demoService;

    @LagouSecurity("zhangsan,lisi")
    @LagouRequestMapping("/handle01")
    public String handle01(HttpServletRequest request, HttpServletResponse response,String username) {
        String result = demoService.get(username);
        System.out.println(result);
        return result;
    }

    @LagouSecurity("wangwu")
    @LagouRequestMapping("/handle02")
    public String handle02(HttpServletRequest request, HttpServletResponse response,String username) {
        String result = demoService.get(username);
        System.out.println(result);
        return result;
    }

    @LagouRequestMapping("/handle03")
    public String handle03(HttpServletRequest request, HttpServletResponse response,String username) {
        String result = demoService.get(username);
        System.out.println(result);
        return result;
    }
}
